package landlords.entity;

import java.util.List;
import java.util.ArrayList;
//剩余人员
public abstract class Room {
    private String roomID;

    public Room(String roomID) {
        this.roomID = roomID;
    }

    public abstract void write(String message);

    public String getRoomID() {
        return roomID;
    }
}

class ChatRoom extends Room {
    private List<String> messages = new ArrayList<String>();

    public ChatRoom(String roomID) {
        super(roomID);
    }

    @Override
    public void write(String message) {
        messages.add(getRoomID() + ": " + message);
        System.out.println(getRoomID() + ": " + message);
    }

    public List<String> getMessages() {
        return messages;
    }
}

class Main {
    public static void main(String[] args) {
        ChatRoom chatRoom = new ChatRoom("Chat Room 123");
        chatRoom.write("Hello, World!");
    }
}